/**
 * @Author Puzzle
 * @Date 2022/6/21 3:06 下午
 **/

package response

import (
	"zsc-boot/app/system_layer/model"
)

type LoginResp struct {
	model.ServiceUserSimple
	Token     string `json:"token" form:"token"`
	ExpiresAt int64  `json:"exporesAt" form:"exporesAt"`
}

type LoginRole struct {
	ID   uint   `json:"ID" form:"ID"`
	Code string `json:"code" form:"code"`
	Name string `json:"name" form:"name"`
}

func (LoginRole) TableName() string {
	return "service_role"
}

type UserInfoResp struct {
	model.ServiceUserSimple
	Role LoginRole `json:"role" form:"role" gorm:"foreignKey:RoleId"`
}

type UserResp struct {
	UserListResp
	Roles []role `json:"roles" form:"roles"`
}

type UserListResp struct {
	model.ServiceUser
	Role ServiceRole `json:"role" form:"role" gorm:"foreignKey:RoleId"` // 角色
}

type ServiceRole struct {
	ID   uint   `json:"ID" form:"ID"`
	Name string `json:"name" form:"name"`
}

type role struct {
	ID   uint   `json:"ID" form:"ID"`
	Name string `json:"name" form:"name"`
}
